import java.text.DecimalFormat;


public class GA {

    public static void main(String[] args) {

       
        // Create an initial population
        Population myPop = new Population(100, true);
        
        // Evolve our population until we reach an optimum solution
        int generationCount = 0;
        DecimalFormat df = new DecimalFormat("#.##");
        System.out.println(myPop.getFittest().getFitness());
        while (true) {
            generationCount++;
            System.out.println("Generation: " + generationCount + " Fittest: " + df.format(myPop.getFittest().getFitness()));
            System.out.println(myPop.getFittest());
            myPop = Algorithm.evolvePopulation(myPop);
            try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				
			}
        }
//        System.out.println("Solution found!");
//        System.out.println("Generation: " + generationCount);
//        System.out.println("Genes:");
        

    }
}
